#ifndef NETPROTOCOL_H
#define NETPROTOCOL_H

#include <QObject>

class netProtocol : public QObject
{
    Q_OBJECT
public:
    explicit netProtocol(QObject *parent = nullptr);

    static netProtocol *getObject();

  bool  userfLogin(QString username,QString password);


  bool controlNormalDevice(QString index,int id,bool state);
  bool requestMessage(int type);
 bool  requestMyDeviceName();


protected:
    void handleFrame(const QByteArray &frame);

    static netProtocol *obj;

signals:
void LoginFeedBack(bool re);
void updateMyDeviceName(const QJsonArray &arr);
void showDodayMessage(const QJsonArray &arr);
void realTimeMessage(const QJsonObject &obj);
public slots:
    void netReadSlot(QByteArray data);
};

#endif // NETPROTOCOL_H
